home *** CD-ROM | disk | FTP | other *** search
/ Ian & Stuart's Australian Mac: Not for Sale / Another.not.for.sale (Australia).iso / fade into you / getting there / TCP⁄PPP⁄SLIP / TCP⁄IP Scripting Addition 1.1.2 / Examples 1.2 / Text Versions / Finger (text) < prev    next >
Text File  |  1994-09-18  |  1KB  |  40 lines

  1. (*
  2. Finger 1.1
  3. Copyright © 1994 by Atul Butte. All Rights Reserved.
  4. *)
  5.  
  6. global CR, LF, CRLF
  7. set LF to (ASCII character of 10)
  8. set CR to (ASCII character of 13)
  9. set CRLF to CR & LF
  10.  
  11. set dialog_response to (display dialog "Enter the name of the machine to check" default answer "")
  12. if (button returned of dialog_response ≠ "OK") then
  13.     return
  14. else
  15.     set email_host to text returned of dialog_response
  16. end if
  17.  
  18. set dialog_response to (display dialog "Enter the e-mail address to check on " & email_host default answer "")
  19. if (button returned of dialog_response ≠ "OK") then
  20.     return
  21. else
  22.     set email_address to text returned of dialog_response
  23. end if
  24.  
  25. set sss to (tcp connect to host email_host port 79)
  26. try
  27.     tcp write data email_address & return using ISO88591 stream sss
  28.     repeat until (bytes waiting of (tcp status stream sss) > 0)
  29.     end repeat
  30.     set response to (tcp read using ISO88591 stream sss)
  31. on error
  32.     tcp close stream sss
  33. end try
  34. tcp close stream sss
  35.  
  36. tell application "Scriptable Text Editor"
  37.     activate
  38.     make new document at beginning
  39.     set selection to response
  40. end tell